﻿using System;
using System.Collections.Generic;
using System.Web;
using CeA.Reports.Atendimento.DataAccess.Criteria;
using System.Text;
using CeA.Reports.Atendimento.DataAccess.DTO;

namespace CeA.Reports.Atendimento.Web.WebControls {
    public class PesquisaRolesEventArgs : EventArgs {
        private List<RoleDTO> m_roles;


        public PesquisaRolesEventArgs()                         {
            m_roles = new List<RoleDTO>();
        }


        public PesquisaRolesEventArgs(List<RoleDTO> roleList)   {
            m_roles = roleList;
        }


        public List<RoleDTO> SelectedRoles                      {
            get { return m_roles; }
            set { m_roles = value; }
        }


        public void addRole(RoleDTO role)                       {
            m_roles.Add(role);
        }

        
        public override string ToString()                       {
            StringBuilder sb = new StringBuilder();

            string[] roles = new string[m_roles.Count];

            for (int i = 0; i < m_roles.Count; i++) {
                roles[i] = m_roles[i].Nome;
            }

            return string.Join("; ", roles);
        }
    }
}
